# _*_ coding : utf-8 _*_
# @Time : 2022/8/14 20:02
# @Author : Moonquake
# @File : 30.request_post请求
# @Project : python
import requests

url = ' https://fanyi.baidu.com/v2transapi?from=en&to=zh'

headers = {
    'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36'

}
data = {
    'query':'eye'
}

# url 请求地址
# data 请求参数
# kwargs 字典
response = requests.post(url=url,data=data,headers=headers)

content = response.text
content.encode('utf-8')
print(content)
import json
obj = json.loads(content)
print(obj)